package com.sap.test;

import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class RabbitMQ {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void rabbitMQ() {
        rabbitTemplate.convertAndSend("rabbit","test","nihao", message -> {
            message.getMessageProperties().setDelayLong(1000L);
            return message;
        });
    }
}
